package so.go4.service.impl;

import org.springframework.stereotype.Service;
import so.go4.dao.IArticleDao;
import so.go4.model.Article;
import so.go4.service.IArticleService;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by SQB on 2015/5/23.
 */
@Service("articleService")
public class ArticleServiceImpl implements IArticleService {

    @Resource
    private IArticleDao articleDao;

    @Override
    public Article getArticleById(int id) {
        return articleDao.selectByPrimaryKey(id);
    }

    @Override
    public List<Article> selectAllContents() {
        return articleDao.selectAllContents();
    }

    @Override
    public List<Article> selectO(int id) {
        return articleDao.selectO(id);
    }

    @Override
    public List<Article> selectTitleWithCate(String categories) {
        return articleDao.selectTitleWithCate(categories);
    }

    @Override
    public List<Article> selectAllContentsWithCate(String categories) {
        return articleDao.selectAllContentsWithCate(categories);
    }

    @Override
    public List<Article> testPojo(Article article) {
        return articleDao.testPojo(article);
    }

    @Override
    public int countArticles(Article article) {
        return articleDao.countArticles(article);
    }
}
